<?
require_once("config.php");
require_once("mysql.php");
include_once("xoadau.php");

$query = query("select id,name from member where name1 like '%".xoadau(trim($_GET['term']))."%'");
while($row = mysql_fetch_array($query))
{
	$results[] = array('label' => $row['name'],'xoadau'=>xoadau($row['name']),'type'=>'1','id'=>$row['id']);
}
$query = query("select id,title,code from baithi where title like '%".trim($_GET['term'])."%' or code like '%".trim($_GET['term'])."%'");
while($row = mysql_fetch_array($query))
{
	$results[] = array('label' => $row['title']." (".$row['code'].")",'id'=>$row['id'],'xoadau'=>xoadau($row['title']),'type'=>'2');
}
$d=json_encode($results);
echo $d;
?>